import vue from '@vitejs/plugin-vue'
import { resolve, path } from 'path'


export default {
    base: './',
    // publicPath: './',
    plugins: [vue()],
    optimizeDeps: {
        include: ['schart.js']
    },
    resolve: {
        alias: {
            '@': resolve(__dirname, 'src')
        }
    },
    // devServer: {                //webpack-dev-server配置
    //     // host: 'localhost',
    //     // port: 3000,            //配置本项目运行端口
    //     proxy: {                //配置代理服务器来解决跨域问题
    //         '/api': {
    //             target: 'http://192.168.3.238:8080',      //配置要替换的后台接口地址
    //             changOrigin: true,                      //配置允许改变Origin
    //             pathRewrite: {
    //                 '^/api': ''
    //             }
    //         },
    //     }
    // },
    server: {
        proxy: {
            // 选项写法
            '/api': {
                target: 'http://192.168.3.235:8080',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        }
    }
}